<?php
/**
 * Created by PhpStorm.
 * User: ASUS
 * Date: 2021/12/12
 * Time: 17:16
 */

class DBtools
{
    private static $conn;
    public static function setconn($conn){
        self::$conn = $conn;
    }
    public static function select($sql){
        $result = self::$conn -> query($sql);
        $data = [];
        while(true){
            $row = $result -> fetch_assoc();
            if (empty($row)){
                break;
            }
            $data[] = $row;
        }
        return $data;
    }
}